#pragma once

#include <d3d9.h>
#include <d3dx9.h>

class CAABBox;
class COBBox;
class CBSphere;

class CDebugGraphics
{
private:
	static CDebugGraphics *m_instance;
private:
	CDebugGraphics(void);
	~CDebugGraphics(void);
	CAABBox *m_aabb;
	COBBox *m_obb;
	CBSphere *m_sphere;
	LPDIRECT3DDEVICE9 m_device;
public:
	static void CreateInstance();
	static void DestroyInstance();	
	static CDebugGraphics& GetInstance();

	bool Initialise(LPDIRECT3DDEVICE9 device); // previously also had flags and then maxLines here defaulting to 32 

	bool RenderAABBox(const D3DXVECTOR3& minBounds,const D3DXVECTOR3 &maxBounds,D3DCOLOR colour);
	bool RenderAABBox(const D3DXVECTOR3& minBounds,const D3DXVECTOR3 &maxBounds,D3DCOLOR colour,const D3DXMATRIX&worldMat);
	bool RenderOBBox(D3DXVECTOR3 *front,D3DXVECTOR3 *back, D3DCOLOR colour);


	bool RenderSphere(const D3DXVECTOR3& sphereCentre,float sphereRadius,D3DCOLOR colour);
	bool RenderAxis(); // TBD
};

#define STARTUP_DBGFX CDebugGraphics::CreateInstance
#define SHUTDOWN_DBGFX CDebugGraphics::DestroyInstance
#define DBG_GFX	CDebugGraphics::GetInstance()

